﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        public enum Qun {
            剪刀=1,
            石头,
            布
            }
           
        static void Main(string[] args)
        {

            Console.WriteLine("------欢 迎 来 到 游 戏 世 界------");
            Console.WriteLine("***********************************");
            Console.WriteLine("***********猜拳，开始**************");
            Console.WriteLine("***********************************");
            text1();
        }

        static void text1()
        {
            int i = 1;
            Npc npc;
            Console.WriteLine("出拳规则：1.剪刀 2.石头 3.布");
            Console.WriteLine("请选择对面角色（1.刘备 2.孙权 3.曹操）");
            int key = int.Parse(Console.ReadLine());
            switch (key)
            {
                case 1:
                    npc = new Npc("刘备");
                    break;
                case 2:
                    npc = new Npc("孙权");
                    break;
                case 3:
                    npc = new Npc("曹操");
                    break;
                default:
                    Console.WriteLine("输入不规范，默认对战刘备");
                    npc = new Npc("刘备");
                    break;
            }
            Console.WriteLine("请输入你的名字");
            string name = Console.ReadLine();
            Figure figure = new Figure(name);
            longin:
            Console.WriteLine("{0} vs {1} 对战",figure.name,npc.name);
            figure.Cun();
            npc.Cun();
            text2(figure, npc);
            Console.WriteLine("要不要下一轮（y/n）");
            string y = Console.ReadLine();
            switch (y)
            {
                case "y":
                    i++;
                    goto longin;
                    break;
                case "n":
                    Console.WriteLine("{0} vs {1} 对战", figure.name, npc.name);
                    Console.WriteLine("对战次数"+i);
                    Console.WriteLine("名字\t得分");
                    Console.WriteLine("{0}\t{1}",figure.name,figure.grade);
                    Console.WriteLine("{0}\t{1}",npc.name,npc.grade);
                    if (figure.grade >=  npc.grade)
                    {
                        Console.WriteLine("结果,{0}赢了，{1}傻逼",figure.name, npc.name);
                    }
                    else
                    {
                        Console.WriteLine("结果,{0}赢了，{1}傻逼", npc.name, figure.name);
                    }
                    Console.WriteLine();
                    Console.WriteLine("要开始下一局吗（y/n）");
                    string n = Console.ReadLine();
                    switch (n)
                    {
                        case "y":

                            text1();
                            break;

                        default:
                            break;
                    }
                    break;
                default:
                    break;
            }
        }
        static void text2(Figure figure, Npc npc) 
        {
            if (figure.FGG==npc.FGG)
            {
                Console.WriteLine("和局，真哀！ 嘿嘿，等着瞧吧！");
                
            }
            else if (figure.FGG+1== npc.FGG || (figure.FGG==3 && npc.FGG==1))
            {
                Console.WriteLine("傻逼，{0}输了",figure.name);
                npc.grade++;
            }
            else
            {
                Console.WriteLine("牛逼，{0}赢了", figure.name);
                figure.grade++;
            }
        }


    }
}
